<div align="center">
	<?php
	if(isset($event) && $event != null)
		printf("<h3>Final result of %s</h3>",$event->year);
	else
		echo "<br/><br/>";
	?>
</div>
<table border="1" width="100%" class="resultgrid">
	<tr>
		<td></td>
		<td>&nbsp;</td>
		<td colspan="5" align="center">Castle Creek</td>
		<td colspan="5" align="center">Stone Bridge</td>
		<td colspan="5" align="center">Mill Pond</td>
		<td colspan="5" align="center">Hago's</td>
		<td colspan="3" align="center">Total</td>
	</tr>
	<tr>
		<td align="center">Ranking</td>
		<td>Player</td>
		<td>Out</td>
		<td>In</td>
		<td>Total</td>
		<td>Par</td>
		<td>1's</td>
		<td>Out</td>
		<td>In</td>
		<td>Total</td>
		<td>Par</td>
		<td>1's</td>
		<td>Out</td>
		<td>In</td>
		<td>Total</td>
		<td>Par</td>
		<td>1's</td>
		<td>Out</td>
		<td>In</td>
		<td>Total</td>
		<td>Par</td>
		<td>1's</td>
		<td>Sum</td>
		<td>Par</td>
		<td>1's</td>
	</tr>
	<?php if(count($resultRows) > 0){
		$counter = 0;
		foreach ($resultRows as $row){?>
		<tr>
			<?php
				$counter++;
				printf("<td align=\"center\">%s</td>",$counter);
				printf("<td><a href=\"?viewProfile=&playerid=%d\">%s</a></td>",$row["playerid"],$row["player"]);
				printf("<td>%s</td>",$row["castlecreek_out"]);
				printf("<td>%s</td>",$row["castlecreek_in"]);
				printf("<td>%s</td>",$row["castlecreek_total"]);
				printf("<td>%s</td>",$row["castlecreek_par"]);
				printf("<td>%s</td>",$row["castlecreek_holein1"]);
				printf("<td>%s</td>",$row["stonebridge_out"]);
				printf("<td>%s</td>",$row["stonebridge_in"]);
				printf("<td>%s</td>",$row["stonebridge_total"]);
				printf("<td>%s</td>",$row["stonebridge_par"]);
				printf("<td>%s</td>",$row["stonebridge_holein1"]);
				printf("<td>%s</td>",$row["millpond_out"]);
				printf("<td>%s</td>",$row["millpond_in"]);
				printf("<td>%s</td>",$row["millpond_total"]);
				printf("<td>%s</td>",$row["millpond_par"]);
				printf("<td>%s</td>",$row["millpond_holein1"]);
				printf("<td>%s</td>",$row["hagos_out"]);
				printf("<td>%s</td>",$row["hagos_in"]);
				printf("<td>%s</td>",$row["hagos_total"]);
				printf("<td>%s</td>",$row["hagos_par"]);
				printf("<td>%s</td>",$row["hagos_holein1"]);
				printf("<td>%s</td>",$row["grand_total"]);
				printf("<td>%s</td>",$row["grand_par"]);
				printf("<td>%s</td>",$row["grand_holein1"]);
			?>
		</tr>
	<?php }
	}
	else{?>
		<tr>
			<td colspan="24" align="center">
				No result found.
			</td>
		</tr>
	<?php }?>
</table>